
<%@ page import="edu.auctionmart.Auction" %>
<!doctype html>
<html>
    <head>
        <meta name="layout" content="mobile">
        <title>Welcome to AuctionMart</title>
        <g:set var="entityName" value="${message(code: 'auction.label', default: 'Auction')}" />
        <title>AuctionMart</title>
    </head>
	<body>
		<g:isLoggedIn>
 			Welcome, ${loggedInUserInfo(field:'username')} (<g:link controller="logout" action="index" id="3">Logout</g:link>)
        </g:isLoggedIn>
        <g:isNotLoggedIn>
        	<g:link controller="login" action="index" id="1">Login</g:link>
        	<g:link controller="user" action="create" id="2">Register</g:link>
        </g:isNotLoggedIn>
	
		<h1>Welcome to AuctionMart</h1>
		<h1>Auctions Ending Soonest</h1>
		<div data-role="header" data-position="fixed">
			<h1>AuctionMart</h1>
			<div data-role="navbar">
				<g:isLoggedIn>
					<ul>
						<li><g:link data-icon="plus" controller="auction" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
						<li><g:link data-icon="grid" data-ajax="false" controller="auction" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></li>
					</ul>
				</g:isLoggedIn>
			</div>
		</div>
		<div data-role="content">
			<g:if test="${flash.message}">
			<div class="message">${flash.message}</div>
			</g:if>
			<ul data-role="listview" data-inset="true" >
				<g:each in="${auctions}" status="i" var="auctionInstance">
					<li>
						<g:link controller="auction" action="show" id="${auctionInstance.id}">${auctionInstance}</g:link>
					</li>
				</g:each>
			</ul>
		</div>
		<div data-role="footer">
		</div>
    </body>
</html>
